<%@ page import="week12.User" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.List" %>
<%--
  Created by IntelliJ IDEA.
  User: 111
  Date: 2022/11/19
  Time: 16:09
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    List list = new ArrayList();
    list.add(new User("张三",22,"福建"));
    list.add(new User("李四",23,"江西"));
    list.add(new User("王五",25,"浙江"));
    request.setAttribute("list",list);
%>
<table border="1" width="500" align="center">
    <tr>
        <td>编号</td>
        <td>姓名</td>
        <td>年龄</td>
        <td>地址</td>
        <td>操作</td>
    </tr>
    <c:forEach items="${list}" var="user" varStatus="s">
        <tr>
            <td>${s.count}</td>
            <td>${user.name}</td>
            <td>${user.age}</td>
            <td>${user.address}</td>
            <td>
                <button onclick="javascript:location.href='/c1/test.jsp?userIndex=${s.index}'">删除</button>
            </td>
        </tr>
    </c:forEach>
</table>

</body>
</html>
